'use strict';

//引入模块
let Koa = require('koa');
let sta = require('koa-static');
let bodyParser = require('koa-bodyparser');
let router = require('./controllers');
let templating = require('./templating');
let Models = require('./Models');

//实例化server服务器
let server = new Koa();

//注册使用中间件
server.use(bodyParser());
server.use(sta(__dirname));
server.use(templating);
server.use(router());

//监听端口
let port = 4000;
server.listen(port,()=>{
    console.log(`http://127.0.0.1:${port}`); 
})